define(['jquery', 'bootstrap', 'frontend'], function ($, undefined, Frontend) {
    var Controller = {
        index: function () {
            $('.carousel').carousel({
                interval: 5000
            });
            if (Config.toptips) {
                $('<div id="topnotice" class="blue-bg pix-white p-3 text-center"><span class="label label-danger">公告</span> ' + Config.toptips.text + ' <a href="' + Config.toptips.url + '" class="pix-white">查看详情 <i class="fa fa-chevron-right"></i></a></div>').prependTo("body");
            }
        },
        store: function () {
            var iso;
            require(['isotope'], function (Isotope) {
                $('.course-filter li a').on("click", function () {
                    if (!iso) {
                        iso = new Isotope($('.course-list > .row')[0], {
                            itemSelector: '.grid-item',
                            layoutMode: 'fitRows'
                        });
                    }
                    var $this = $(this), filterValue = $this.attr('data-filter');
                    iso.arrange({filter: filterValue});
                    return false;
                });
            });
        }
    };

    return Controller;
});
